package com.bdqn.t320.ch05.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.bdqn.t320.ch05.entity.SysUser;
import com.bdqn.t320.ch05.mapper.SysUserMapper;
import com.bdqn.t320.ch05.service.ISysUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author czkt
 * @since 2022-09-06
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {

    @Resource
    SysUserMapper sysUserMapper;

    @Override
    public SysUser doLogin(String usrName, String usrPassword) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("usr_name", usrName);
        queryWrapper.eq("usr_password", usrPassword);
        return sysUserMapper.selectOne(queryWrapper);
    }
}
